package member.controller;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import member.model.service.MemberService;
import member.to.ActionForward;
import member.to.MemberTO;

public class GetAllMemberInfoController implements Controller {

	@Override
	public ActionForward handle(HttpServletRequest request,
			HttpServletResponse response){
		ActionForward af = null;
		try {
			MemberService mms = MemberService.getInstance();
			ArrayList<MemberTO> list = mms.getMemberList();
			request.setAttribute("member_list", list);
			af = new ActionForward("/member_list.jsp", false);
		} catch (Exception e) {
			e.printStackTrace();
			request.setAttribute("error_message", e.getMessage());
			af = new ActionForward("/error.jsp", false);;
		}
		return af;
	}

}
